class Animal {
  public sayHello(): void {
    console.log("Some animal sound");
  }
}

class Dog extends Animal {
  public sayHello(): void {
    console.log("Bark");
  }
}

class Cat extends Animal {
  public sayHello(): void {
    console.log("Meow");
  }
}

const obj = {
  sayHello() {
    console.log("Hello");
  },
};

function playSound(animal: Animal) {
  animal.sayHello();
}

const dog = new Dog();
const cat = new Cat();
playSound(dog);
playSound(cat);
playSound(obj);
